{$CLEO}

0A95: enable_thread_saving

const
  __to_x = 5@
  __to_y = 6@
  __to_z = 7@
  _offset = 8@
  __hydra_handler = 30@
  __hydra_pilot = 29@
  _addr = 11@
  __constr_ve_handler = 31@
  __count = 16@
  __state = 17@
  __angle = 18@
  __random = 19@
  __stater = 20@
  _stor_pos_x = 21@
  _stor_pos_y = 22@
  _stor_pos_z = 23@
  __get_targed = 25@
  __is_ped_type = 26@
  __count_2 = 27@
  __count_4 = 28@
  _dis_2 = 10@
  _dis_1 = 9@
end

{$CLEO}

0A95: enable_thread_saving

const

end

{$CLEO}

0A95: enable_thread_saving



// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

0000:

0390: load_txd_dictionary 'LD_DUAL'
038F: load_texture "white" as 10

Model.Load(#HYDRA)
Model.Load(#FAM1)
Model.Load(1636)
038B: load_requested_models 

04C4: store_coords_to __to_x __to_y __to_z from_actor $PLAYER_ACTOR with_offset 0.0 -100.0 80.0 
__hydra_handler = Car.Create(#HYDRA, __to_x, __to_y, __to_z)
Actor.StorePos($PLAYER_ACTOR, __to_x, __to_y, __to_z)
Car.SetImmunities(__hydra_handler, 1, 1, 1, 1, 1)
039F: set_car __hydra_handler race_to __to_x __to_y 
0825: set_helicopter __hydra_handler instant_rotor_start 
__hydra_pilot = Actor.CreateAsDriver(Gang2, #FAM1, __hydra_handler)
Actor.RemoveFromMissionCleanupList(__hydra_pilot)
Actor.Health(__hydra_pilot) = 100000
Actor.SetImmunities(__hydra_pilot, 1, 1, 1, 1, 1)
24@ = Marker.CreateAboveActor(__hydra_pilot)
04C4: store_coords_to __to_x __to_y __to_z from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0 
04D2: set_plane __hydra_handler fly_autopilot_around_point __to_x __to_y __to_z altitude_between 30.0 and 30.0 
0745: set_hydra __hydra_handler thrust_to_horizontal 
0338: set_car __hydra_handler visibility 0 
//067C: put_camera_on_actor $_hydra_pilot offset 0.0 -3.9 2.1 rotation 0.0 0.0 0.0 tilt 0.0 switchstyle 2 
        
FOR __count = 0 TO 8 STEP 1
    0085: _offset = __count 
    _offset *= 4
    0AC6: _addr = label @handle offset
    005A: _addr += _offset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    0A8D: __constr_ve_handler = read_memory _addr size 4 virtual_protect 0
    if __constr_ve_handler > 0
    jf continue
    if 056E:   car __constr_ve_handler defined
    jf continue
    car.RemoveReferences(__constr_ve_handler)
    car.Destroy(__constr_ve_handler)
END

MODEL.Load(#COMET)
038B: load_requested_models 


FOR __count = 0 TO 8 STEP 1
    0085: _offset = __count 
    _offset *= 4
    04C4: store_coords_to __to_x __to_y __to_z from_actor $PLAYER_ACTOR with_offset 0.0 2.0 1.0 
    __constr_ve_handler = car.Create(#COMET,__to_x,__to_y,__to_z)                                                                                                                                                                   
    Car.Angle(__constr_ve_handler) = 184.7214
    0229: set_car __constr_ve_handler primary_color_to 0 secondary_color_to 0 
    099A: set_car __constr_ve_handler collision_detection 0
    03ED: set_car __constr_ve_handler disable_flipped_explosion_when_empty 1 
    Car.SetImmunities(__constr_ve_handler, 1, 1, 1, 1, 1)

    0AC6: _addr = label @handle offset
    005A: _addr += _offset                                                                                                                                                               
    0A8C: write_memory _addr size 4 value __constr_ve_handler virtual_protect 0
END


WHILE TRUE
    WAIT 0
    0ab3: 569 > __hydra_pilot //send_handler
    0ab4: __state < 570 //get$state
    __angle = 0.0
    FOR __count = 0 TO 8 STEP 1
        if 056E:   car __hydra_handler defined
        jf continue       
        //IF 01F3:   car $hydra_handler in_air
        //jf @CLEAN
        IF __state == FALSE                                                                                            
        jf @CLEAN                                                                                                     
        0085: _offset = __count                                                                                                       
        _offset *= 4                                                                                                             
        0AC6: _addr = label @handle offset                                                                                     
        005A: _addr += _offset
        if _addr < 0x3D94AD8E
        jf continue                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
        0A8D: __constr_ve_handler = read_memory _addr size 4 virtual_protect 0
        if __constr_ve_handler > 0
        jf continue                                                                  
        __angle += 40.0                                                                                                     
        if __angle > 360.0                                                                                                  
        then __angle = 0.0                                                                                                  
        end                                                                                                                 
        0407: store_coords_to __to_x __to_y __to_z from_car __hydra_handler with_offset 0.0 0.0 -1.0
        if __constr_ve_handler > 0                                                                                                           
        jf continue                                                                                                         
        if 056E:   car __constr_ve_handler defined                                                                                           
        jf continue                                                                                                         
        CAR.PutAt(__constr_ve_handler, __to_x, __to_y, __to_z)                                                                                          
        0683: attach_car __constr_ve_handler to_car __hydra_handler with_offset 0.0 0.0 0.0 rotation 0.0 0.0 __angle
        IF 33@ >= 6000                                                                                                     
        THEN 33@ = 0                                                                                                       
            0209: __random = random_int_in_ranges 1 5                                                                           
            if __random == 1                                                                                                    
            then GOSUB @wats_hapen1                                                                                        
            end                                                                                                            
            if __random == 2                                                                                                    
            then GOSUB @wats_hapen2                                                                                        
            end                                                                                                            
            if __random == 3                                                                                                    
            then GOSUB @wats_hapen3                                                                                        
            end                                                                                                            
            if __random == 4                                                                                                    
            then GOSUB @wats_hapen4                                                                                        
            end                                                                                                            
            if __random == 5                                                                                                    
            then GOSUB @wats_hapen4                                                                                        
            end                                                                                                              
            09E5: create_flash_light_at __to_x __to_y __to_z RGB_mask 0 255 255 radius 30.0                                         
            024F: create_corona_with_radius 10.0 type 2 lensflares 0 with_color 0 255 255 at __to_x __to_y __to_z                   
        end                                                                                                                
    end
    if 81F3:   not car __hydra_handler in_air 
    then
        0407: store_coords_to __to_x __to_y __to_z from_car __hydra_handler with_offset 0.0 0.0 100.0
        CAR.PutAt(__hydra_handler, __to_x, __to_y, __to_z)     
    end
END

:CLEAN
0ACA: "CLEAN" 
FOR __count = 0 TO 8 STEP 1
    0085: _offset = __count 
    _offset *= 4
    0AC6: _addr = label @handle offset
    005A: _addr += _offset                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    0A8D: __constr_ve_handler = read_memory _addr size 4 virtual_protect 0
    if __constr_ve_handler > 0
    jf continue
    if 056E:   car __constr_ve_handler defined
    jf continue
    car.RemoveReferences(__constr_ve_handler)
    car.Destroy(__constr_ve_handler)
END
car.RemoveReferences(__hydra_handler)
actor.RemoveReferences(__hydra_pilot)
end_thread



:wats_hapen1
//0ACA: "ATTACK1"  
FOR __stater = 0 TO 0 STEP 1             
    Actor.StorePos(__hydra_pilot, _stor_pos_x, _stor_pos_y, _stor_pos_z)                                                                                                                                                             
    if 0AE1: __get_targed = random_actor_near_point _stor_pos_x _stor_pos_y _stor_pos_z in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                              
    jf continue                                                                                                                                                                                    
    if not __get_targed == -1                                                                                                                                                                       
    jf continue                                                                                                                                                                                    
    089F: get_actor __get_targed pedtyp_to __is_ped_type                                                                                                                                                      
    if not __is_ped_type == 8 //vehicle gunner                                                                                                                                                               
    jf continue
    04C4: store_coords_to 12@ 13@ 14@ from_actor __get_targed with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(__hydra_handler, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(__hydra_handler) = TRUE
    for __count_2 = 0 to 10 step 1
        IF 056D:   actor __get_targed defined                                                                                                                                                        
        JF BREAK                                                                                                     
        if not actor.Dead(__get_targed)                                                                                       
        JF BREAK                                                                                                     
        04C4: store_coords_to 0@ 1@ 2@ from_actor __get_targed with_offset 0.0 1.0 0.5                                        
        if __count_2 == __count_2                                                                                                
        then                                                                                                         
        0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@         
        0AB1: @DRAW_OUTLINED_BOX 9 POS 3@ 4@ SIZE 50.0 100.0 RGBA 255 0 0 255 THICKNESS 0.5                          
        //0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 2.0                                
        end                                                                                                          
        0948: create_explosion_at 0@ 1@ 2@ type 1 {fire this targed} camera_shake 1.0                                
        wait 0                                                                                                       
    end
    Car.LockInCurrentPosition(__hydra_handler) = FALSE                                                                                                                                                             
    04C4: store_coords_to __to_x __to_y __to_z from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane __hydra_handler fly_autopilot_around_point __to_x __to_y __to_z altitude_between 30.0 and 30.0
end
return

:wats_hapen2
//0ACA: "ATTACK2"  
FOR __stater = 0 TO 0 STEP 1                                                                                                                                                                                                                                                                                                                                  
    Actor.StorePos(__hydra_pilot, _stor_pos_x, _stor_pos_y, _stor_pos_z)                                                                                                                                                               
    if 0AE1: __get_targed = random_actor_near_point _stor_pos_x _stor_pos_y _stor_pos_z in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                                          
    jf continue                                                                                                                                                                                
    if not __get_targed == -1                                                                                                                                                                                   
    jf continue                                                                                                                                                                                
    089F: get_actor __get_targed pedtyp_to __is_ped_type                                                                                                                                                                  
    if not __is_ped_type == 8 //vehicle gunner                                                                                                                                                           
    jf continue                                                                                                                                                                                        
    04C4: store_coords_to 12@ 13@ 14@ from_actor __get_targed with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(__hydra_handler, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(__hydra_handler) = TRUE                                                                                                                                                              
    VAR                                                                                                                                                                                          
    _dis_1:FLOAT                                                                                                                                                                                          
    _dis_2:FLOAT
    __count_4:FLOAT                                                                                                                                                                                                
    END                                                                                                                                                                                                
    0819: _dis_1 = actor __hydra_pilot distance_from_ground                                                                                                                                                                
    _dis_1 -= 10.0                                                                                                                                                                                         
    0819: _dis_2 = actor __get_targed distance_from_ground                                                                                                                                                         
    33@ = 0
    0ab3: 568 > true     
    0A92: create_custom_thread "14FA51F5D0\ship_func.CS"             
    for __count_4 = _dis_2 to _dis_1 step 0.2                                                                                                                                                                  
        if 33@ >= 12000                                                                                                                                                                             
        then break                                                                                                                                                                                      
        end                                                                                                                                                  
        IF 056D:   actor __get_targed defined                                                                                                                                                            
        JF BREAK
        if not actor.Dead(__get_targed)
        JF BREAK                                                                                                                                                                                 
        083C: set_actor __get_targed velocity_in_direction_XYZ 0.0 0.0 _dis_1                                                                                                                                   
        04C4: store_coords_to 12@ 13@ 14@ from_actor __get_targed with_offset 0.0 0.0 0.0                                                                                                               
        04C4: store_coords_to __to_x __to_y __to_z from_actor __hydra_pilot with_offset 0.0 0.0 -0.4                                                                                                              
        024F: create_corona_with_radius 2.0 type 2 lensflares 0 with_color 0 255 255 at 12@ 13@ 14@                                                                                                    
        024F: create_corona_with_radius 0.5 type 2 lensflares 0 with_color 0 255 255 at __to_x __to_y __to_z                                                                                                    
        0393: actor __get_targed perform_animation "RUN_ARMED" at 20.0 times_normal_rate                                                                                                                       
        0393: actor __get_targed perform_animation "SPRINT_CIVI" at 20.0 times_normal_rate                                                                                                             
        0332: set_actor __get_targed bleeding 1                                                                                                                                                         
        WAIT 0                                                                                                                                                                                 
    end                                                                                                                                                                                                
    Car.LockInCurrentPosition(__hydra_handler) = FALSE                                                                                                                                                             
    04C4: store_coords_to __to_x __to_y __to_z from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane __hydra_handler fly_autopilot_around_point __to_x __to_y __to_z altitude_between 30.0 and 30.0
    0ab3: 568 > false                                                                                                          
end                                                                                                                                                                                                    
RETURN

:wats_hapen3
//0ACA: "ATTACK3"  
FOR __stater = 0 TO 0 STEP 1             
    Actor.StorePos(__hydra_pilot, _stor_pos_x, _stor_pos_y, _stor_pos_z)                                                                                                                                                             
    if 0AE1: __get_targed = random_actor_near_point _stor_pos_x _stor_pos_y _stor_pos_z in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                              
    jf continue                                                                                                                                                                                    
    if not __get_targed == -1                                                                                                                                                                       
    jf continue                                                                                                                                                                                    
    089F: get_actor __get_targed pedtyp_to __is_ped_type                                                                                                                                                      
    if not __is_ped_type == 8 //vehicle gunner                                                                                                                                                               
    jf continue
    04C4: store_coords_to 12@ 13@ 14@ from_actor __get_targed with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(__hydra_handler, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(__hydra_handler) = TRUE
    for __count_2 = 0 to 10 step 1
        IF 056D:   actor __get_targed defined                                                                                                                                                        
        JF BREAK                                                                                                                
        if not actor.Dead(__get_targed)                                                                                                  
        JF BREAK                                                                                                                
        04C4: store_coords_to 0@ 1@ 2@ from_actor __get_targed with_offset 0.0 1.0 0.5                                                   
        if __count_2 == __count_2                                                                                                           
        then                                                                                                                    
            0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@                
            0AB1: @DRAW_OUTLINED_BOX 9 POS 3@ 4@ SIZE 50.0 50.0 RGBA 0 255 0 200 THICKNESS 3.5                                  
            //0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 2.0                                       
        end                                                                                                                     
        0208: 1@ = random_float_in_ranges -1.2 1.2                                                                              
        0208: 2@ = random_float_in_ranges -1.2 1.2                                                                              
        04C4: store_coords_to 0@ 1@ 2@ from_actor __get_targed with_offset 1@ 0.0 2@                                                     
        06BC: create_M4_shoot_from _stor_pos_x _stor_pos_y _stor_pos_z target 0@ 1@ 2@ energy 50                                                        
        wait 0                                                                                                                  
    end
    Car.LockInCurrentPosition(__hydra_handler) = FALSE                                                                                                                                                             
    04C4: store_coords_to __to_x __to_y __to_z from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane __hydra_handler fly_autopilot_around_point __to_x __to_y __to_z altitude_between 30.0 and 30.0
end
return


:wats_hapen4
//0ACA: "ATTACK4"  
FOR __stater = 0 TO 0 STEP 1             
    Actor.StorePos(__hydra_pilot, _stor_pos_x, _stor_pos_y, _stor_pos_z)                                                                                                                                                             
    if 0AE1: __get_targed = random_actor_near_point _stor_pos_x _stor_pos_y _stor_pos_z in_radius 1000.0 find_next 1 pass_deads 0 //IF and SET                                                                              
    jf continue                                                                                                                                                                                    
    if not __get_targed == -1                                                                                                                                                                       
    jf continue                                                                                                                                                                                    
    089F: get_actor __get_targed pedtyp_to __is_ped_type                                                                                                                                                      
    if not __is_ped_type == 8 //vehicle gunner                                                                                                                                                               
    jf continue
    04C4: store_coords_to 12@ 13@ 14@ from_actor __get_targed with_offset 0.0 0.0 30.0                                                                                                                          
    Car.PutAt(__hydra_handler, 12@, 13@, 14@)                                                                                                                                                              
    Car.LockInCurrentPosition(__hydra_handler) = TRUE
    for __count_2 = 0 to 10 step 1
        IF 056D:   actor __get_targed defined                                                                                                                                                        
        JF BREAK
        if not actor.Dead(__get_targed)                                                                                                  
        JF BREAK                                                                                                                 
        04C4: store_coords_to 0@ 1@ 2@ from_actor __get_targed with_offset 0.0 1.0 0.5                                             
        if __count_2 == __count_2                                                                                                     
        then                                                                                                              
            0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@          
            0AB1: @DRAW_OUTLINED_BOX 9 POS 3@ 4@ SIZE 50.0 100.0 RGBA 255 0 0 255 THICKNESS 0.5                           
            //0AB1: @DRAW_LINE 9 POS 3@ 4@  _TO_ 200.0 400.0 RGBA 255 0 0 255 THICKNESS 2.0                                 
        end                                                                                                               
        0948: create_explosion_at 0@ 1@ 2@ type 0 {fire this targed} camera_shake 1.0                                     
        wait 0                                                                                                            
    end
    Car.LockInCurrentPosition(__hydra_handler) = FALSE                                                                                                                                                             
    04C4: store_coords_to __to_x __to_y __to_z from_actor $PLAYER_ACTOR with_offset 0.0 10.0 30.0                                                                                                               
    04D2: set_plane __hydra_handler fly_autopilot_around_point __to_x __to_y __to_z altitude_between 30.0 and 30.0
end
return



//
:DRAW_LINE
0087: 11@ = 2@ // (float)
0087: 12@ = 3@ // (float)
0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@
10@ -= 37.0 {REMOVE STRANGE OFFSET AT END}
0063: 2@ -= 0@ // (float) 
0063: 3@ -= 1@ // (float) 
0604: get_Z_angle_for_point 2@ 3@  store_to 9@
9@ += 84.0
005B: 0@ += 11@
0@ /= 2.0    {MITTE} // get center pos
005B: 1@ += 12@
1@ /= 2.0
03F0: enable_text_draw 1
074B: draw_texture 10 position 0@ 1@ scale 10@ 8@ angle 9@ color 4@ 5@ 6@ 7@
0AB2: 0

:DRAW_OUTLINED_BOX
0087: 14@  = 8@ // (float)
0087: 12@ = 2@ // (float)
0087: 13@ = 3@ // (float)
12@ /= 2.0 // (float)
13@ /= 2.0 // (float)
0087: 8@  = 0@ // (float)
005B: 8@ += 2@  // (float)
0063: 8@ -= 12@  // (float) 
0087: 9@  = 0@ // (float) 
0063: 9@ -= 2@  // (float)
005B: 9@ += 12@  // (float) 
0087: 10@ = 1@ // (float)
005B: 10@ += 3@  // (float) 
0063: 10@ -= 13@  // (float) 
0087: 11@ = 1@ // (float)     by OpcodeXe
0063: 11@ -= 3@  // (float)
005B: 11@ += 13@  // (float)   
03F0: enable_text_draw 1                                    
038E: draw_box_position  8@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@ //  links
038E: draw_box_position  9@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@  // rechts
038E: draw_box_position  0@ 10@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // oben 
038E: draw_box_position  0@ 11@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // unten 
0AB2: 0



//
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6  0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@








:handle
hex
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
00 00 00 00
end 



                                                                                                
    


